import React, {Component} from 'react';
import PropTypes from 'prop-types';
import TodoList from '../TodoList/index.jsx';

class TodoListShow extends Component {

  constructor(props) {
    super(props);
  }

  static propTypes = {
    listContent: PropTypes.array.isRequired, //列表数据
    _onDeleteClick: PropTypes.func.isRequired,
    _onEditorClick: PropTypes.func.isRequired,
    _stateChangeClick: PropTypes.func.isRequired
  }

  static defaultProps = {

  }

  render() {
    const {
      _onEditorClick,
      _onDeleteClick,
      _stateChangeClick,
      listContent
    } = this.props;

    return (

      <div>
        {
          listContent.map((item, id) => {
            return (
              <div key = {id}>
                <TodoList
                  {...item}
                  _onDeleteClick = {_onDeleteClick}
                  _onEditorClick = {_onEditorClick}
                  _stateChangeClick = {_stateChangeClick}
                />
              </div>
            );
          })
        }
      </div>
    );
  }
}


export default TodoListShow;
